package com.java.测试中文路径;

import org.junit.Test;

import java.io.File;
import java.net.URISyntaxException;

/**
 * @author wangning
 * @create 2021-05-12 11:54
 */
public class TestChinesePath01 {
	@Test
	public void test01() {
		File file = new File("D:\\workspace\\idea-workspace\\JavaStudyNotes\\src\\main\\java\\com\\java\\测试中文路径\\TestChinesePath01.java");
		System.out.println(file.getPath());
	}

	@Test
	public void test02() throws URISyntaxException {
		String path = Thread.currentThread().getContextClassLoader().getResource("application.properties").getPath();
		String path1 = Thread.currentThread().getContextClassLoader().getResource("application.properties").toURI().getPath();
		System.out.println("path = " + path);
		System.out.println("path1 = " + path1);
	}
}
